package com.antt.cn.mylibary.activities;

import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.antt.cn.mylibary.R;
import com.antt.cn.mylibary.base.BaseActivity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Ant on 2017/5/27  11:41
 * <p>
 * <p>
 *
 * @version 1.0.0
 * @auther Ant
 */

public   class BaseMainActivity extends BaseActivity {
    private ListView mListView;

    protected List<String> strList;
    protected List<Class<? extends BaseActivity>> clsList;


    @Override
    public int getLayoutId() {
        strList = new ArrayList<>();
        clsList = new ArrayList<>();
        return R.layout.ac_main_layout;
    }


    @Override
    public void initView() {
        mListView = (ListView) findViewById(R.id.ac_main_listView);
    }

    @Override
    public void initData() {
        getListViewData();
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, strList);
        mListView.setAdapter(adapter);
    }

    public void getListViewData() {

    }

    @Override
    public void initListener() {
        mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                goTo(clsList.get(position));
            }
        });
    }

}
